package com.company.strategy.type2;

/**
 * 上下文角色，优惠券上下文
 */
public class CouponContext {

    private CouponStrategy strategy;

    public CouponContext(CouponStrategy strategy){
        this.strategy = strategy;
    }

    /**
     * 根据策略计算订单的价格
     * @param order
     * @return
     */
    public double executeStrategy(Order order){
        return strategy.computePrice(order);
    }

}
